<% layout('/layouts/default.html', {title: '过程审核-任务部署审核', libs: ['dataGrid']}){ %>
<div class="main-content">
	<div class="box box-main">
		<div class="box-header">
			<div class="box-tools pull-left" style="position: relative">
				<ul class="nav nav-tabs bangPing-tabs">
					<li class="active"><a href="${ctx}/audit/dcSupTaskAudit/list?auditType=arrange&type=wait">${text('待审核')}</a></li>
					<li ><a href="${ctx}/audit/dcSupTaskAudit/list?auditType=arrange&type=done">${text('审核历史')}</a></li>
				</ul>
			</div>
			<#form:form id="searchForm" model="${dcSupTaskAudit}" action="${ctx}/audit/dcSupTaskAudit/listData?auditType=arrange&auditStatus=1" method="post" class="form-inline"
			data-page-no="${parameter.pageNo}" data-page-size="${parameter.pageSize}" data-order-by="${parameter.orderBy}">
			<div style="float: right">
				<div class="form-group">
					<label class="control-label">${text('任务年度')}：</label>
					<div class="control-inline width-120">
						<#form:select path="taskYear" items="${yearList}" blankOption="true" data-placeholder="请选择" itemLabel="yearLabel" itemValue="yearValue" class="form-control width-120" />
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('任务标题')}：</label>
					<div class="control-inline width-160">
						<#form:input path="taskTitle" maxlength="200" class="form-control width-160" placeholder="请输入任务标题"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('任务类型')}：</label>
					<div class="control-inline width-160">
						<#form:select path="taskTypeCode" items="${dicts}" blankOption="true" data-placeholder="请选择" itemLabel="dictLabel" itemValue="dictValue" class="form-control width-160"/>
					</div>
				</div>
				<div class="form-group">
					<button type="submit" class="btn btn-primary btn-sm">${text('查询')}</button>
					<button onclick="cz();" class="btn btn-default btn-sm">${text('重置')}</button>
				</div>
			</div>
			</#form:form>
		</div>
		<div class="box-body">
			<table id="dataGrid"></table>
			<div id="dataGridPage"></div>
		</div>
	</div>
</div>
<% } %>
<script>
	//重置
	function cz(){
		searchForm.reset();
		$('#dataGrid').dataGrid('reloadGrid');
	}

	// 初始化DataGrid对象
$('#dataGrid').dataGrid({
	searchForm: $("#searchForm"),
	sortableColumn: false, // 列表不允许排序
	columnModel: [
		{header:'${text("主键")}', name:'id', index:'a.id', width:150, align:"left", frozen:true, hidden:true},
		{header:'${text("任务标题")}', name:'taskTitle', index:'a.task_title', width:150, align:"left"},
		{header:'${text("任务内容")}', name:'taskContent', index:'a.task_content', width:250, align:"left", formatter: function(val, obj, row, act){
				return '<a href="${ctx}/taskdeploy/dcSupTaskInfo/detailForm?id='+row.taskId+'" class="btnList" data-title="${text("督办任务信息")}">'+(val||'暂无内容')+'</a>';
			}},
		{header:'${text("完成时限")}', name:'taskEndTime', index:'a.task_end_time', width:120, align:"center",
			formatter:'date', formatoptions:{srcformat:'Y-m-d H:i:s',newformat:'Y-m-d H:i'}},
		{header:'${text("任务整理时间")}', name:'arrangeTime', index:'a.arrange_time', width:120, align:"center",
			formatter:'date', formatoptions:{srcformat:'Y-m-d H:i:s',newformat:'Y-m-d H:i'}},
		{header:'${text("审核类型")}', name:'auditType', hidden:true,index:'a.audit_type', width:150, align:"left", formatter: function(val, obj, row, act){
			return js.getDictLabel(${@DictUtils.getDictListJson('dc_audit_type')}, val, '${text("未知")}', true);
		}},
		{header:'${text("操作")}', name:'actions', width:120, align:"center", formatter: function(val, obj, row, act){
				var actions = [];
			<% if(hasPermi('audit:dcSupTaskAudit:edit')){ %>
					actions.push('<a href="${ctx}/audit/dcSupTaskAudit/form?id='+row.id+'" class="btn btn-primary btn-xs btnList" title="${text("审核")}">审核</a>&nbsp;');
				<% } %>
				return actions.join('');
			}}
	],
	// 加载成功后执行事件
	ajaxSuccess: function(data){
		
	}
});
</script>